
import 'package:baselib/utils/color_base_util.dart';
import 'package:baselib/utils/px_base_util.dart';
import 'package:flutter/material.dart';

class GradientTextWidget extends StatelessWidget{
  Gradient gradient;
  BlendMode blendMode;
  String txt;
  TextStyle txtStyle;
  GradientTextWidget({this.gradient,this.blendMode,this.txt,this.txtStyle});
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return ShaderMask(
      shaderCallback: (Rect bounds){
        return (gradient??LinearGradient(colors: [
          ColorBaseUtil().color_7776FF,
          ColorBaseUtil().color_AD2CF1,
        ])).createShader(bounds);
      },
      blendMode: BlendMode.srcATop,
      child: Text(
        txt??'',
        style: txtStyle??TextStyle(
            fontSize: PxBaseUtil().px_12,
            color: ColorBaseUtil().color_5B5A5A
        ),
      ),
    );
  }

}